<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    $router->group(['prefix' => 'goods'], function () use ($router) {
        $router->resource('goodsTest', TestController::class);

        $router->get('testIndex', 'GoodsController@testIndex');
        $router->get('testForm', 'GoodsController@testForm');

        $router->get('goods', 'GoodsController@goodsList');//全部商品列表
        $router->get('goodsAdd', 'GoodsController@goodsAdd');//商品添加页面
        $router->post('goodsAdd', 'GoodsController@goodsAdd');//商品添加
        $router->get('goodsEdit', 'GoodsController@goodsEdit');//商品编辑
        $router->post('goodsEdit', 'GoodsController@goodsEdit');//商品编辑
        $router->get('goodsShow', 'GoodsController@goodsShow');//商品查看
        $router->get('goodsAttr', 'GoodsController@goodsAttr');//商品参数
        $router->post('goodsAttr', 'GoodsController@goodsAttr');//商品参数
        $router->get('attrHtml', 'GoodsDoController@attrHtml');//商品参数html
        $router->post('goodsAttrDelete', 'GoodsDoController@goodsAttrDelete');//商品参数删除
        $router->post('goodsAttrEdit', 'GoodsDoController@goodsAttrEdit');//商品参数删除

        $router->get('goodsAddImg', 'GoodsController@goodsAddImg');//商品图片添加
        $router->post('goodsAddImg', 'GoodsController@goodsAddImg');//商品图片添加
        $router->post('goodsDeleteImg', 'GoodsDoController@goodsDeleteImg');//商品图片删除


        $router->get('checkGoodsList', 'GoodsController@checkGoodsList');//待审核商品列表
        $router->get('upGoodsList', 'GoodsController@upGoodsList'); //上架商品列表
        $router->get('downGoodsList', 'GoodsController@downGoodsList'); //下架商品列表
        $router->get('noSubmitGoodsList', 'GoodsController@noSubmitGoodsList'); //未提交(驳回)的商品列表

        $router->delete('delete', 'GoodsDoController@delete'); //软删除商品
        $router->post('batchDeal', 'GoodsDoController@batchDeal'); //批量处理软删除，下架，驳回
        $router->post('getCategory', 'GoodsDoController@getCategory'); //根据渠道获取对应的分类

        $router->post('shangjia', 'GoodsDoController@shangjia'); //上架

        $router->post('ajaxDel', 'GoodsDoController@ajaxDel'); //删除或不删除

        $router->post('goodsChannelInfo', 'GoodsDoController@goodsChannelInfo'); //商品的渠道信息

        $router->get('goodsLease', 'GoodsController@goodsLease'); //商品的租期展示
        $router->get('goodsLeaseSet', 'GoodsController@goodsLeaseSet'); //商品的渠道信息
        $router->post('goodsLeaseSet', 'GoodsController@goodsLeaseSet'); //商品的租期设置
        $router->get('goodsLeaseEdit', 'GoodsController@goodsLeaseEdit'); //商品的租期编辑
        $router->post('goodsLeaseEdit', 'GoodsController@goodsLeaseEdit'); //商品的租期编辑

        $router->get('getZuqiHtml', 'GoodsDoController@getZuqiHtml'); //获取租期的html

        $router->get('sku', 'GoodsController@sku'); //商品的销售属性
        $router->post('sku', 'GoodsController@sku'); //商品的销售属性

        $router->get('skuHtml', 'GoodsDoController@skuHtml'); //商品的销售属性

        $router->post('ajaxEditAttrType', 'GoodsDoController@ajaxEditAttrType'); //编辑商品销售属性

        $router->post('ajaxDelAttrType', 'GoodsDoController@ajaxDelAttrType'); //删除销售属性

        $router->post('ajaxEditAttrVal', 'GoodsDoController@ajaxEditAttrVal'); //编辑销售属性值
        $router->post('ajaxDelAttrVal', 'GoodsDoController@ajaxDelAttrVal'); //删除销售属性值

        $router->post('ajaxUploadAttrImg', 'GoodsDoController@ajaxUploadAttrImg'); //属性值图片上传

        $router->post('ajaxDelAttrImg', 'GoodsDoController@ajaxDelAttrImg'); //删除属性值图片

        $router->post('ajaxSetGoodsSku', 'GoodsDoController@ajaxSetGoodsSku'); //设置一组商品sku
        $router->get('goodsSku', 'GoodsController@goodsSku'); //商品sku列表

        $router->post('goodsSkuEdit', 'GoodsController@goodsSkuEdit'); //商品sku编辑
        $router->get('goodsSkuEdit', 'GoodsController@goodsSkuEdit'); //商品sku编辑

        $router->post('goodsSkuDelete', 'GoodsDoController@goodsSkuDelete'); //商品sku删除
        $router->post('getLeaseMoneys', 'GoodsDoController@getLeaseMoneys'); //获取租期三个金额参数


        $router->post('testUpload', 'GoodsController@testUpload'); //图片上传测试
        $router->get('testUpload', 'GoodsController@testUpload'); //图片上传测试


    });


    $router->group(['prefix' => 'category'], function () use ($router) {
        $router->get('index', 'CategoryController@index');//分类列表
        $router->get('add', 'CategoryController@add');//分类添加
        $router->post('add', 'CategoryController@add');//分类添加
        $router->get('edit', 'CategoryController@edit');//分类编辑
        $router->post('edit', 'CategoryController@edit');//分类编辑
        $router->post('delImg', 'CategoryController@delImg');//删除分类图片

        $router->post('getCategory', 'CategoryController@getCategory');//根据渠道获取分类

        $router->get('getChildHtml', 'CategoryController@getChildHtml');//获取子类html

    });

    $router->group(['prefix' => 'brand'], function () use ($router) {
        $router->get('index', 'BrandController@index');//分类列表
        $router->get('add', 'BrandController@add');//分类添加
        $router->post('add', 'BrandController@add');//分类添加
        $router->get('edit', 'BrandController@edit');//分类编辑
        $router->post('edit', 'BrandController@edit');//分类编辑
        $router->post('delete', 'BrandController@delete');//删除分类

        $router->post('delImg', 'BrandController@delImg');//删除分类图片

        $router->post('ajaxFieldsEdit', 'BrandController@ajaxFieldsEdit');//单独更新字段

    });

    $router->group(['prefix' => 'channel'], function () use ($router) {
        $router->get('index', 'ChannelController@index');//渠道列表
        $router->get('add', 'ChannelController@add');//渠道添加
        $router->post('add', 'ChannelController@add');//渠道添加
        $router->get('edit', 'ChannelController@edit');//渠道编辑
        $router->post('edit', 'ChannelController@edit');//渠道编辑
        $router->post('delete', 'ChannelController@delete');//删除渠道

        $router->post('delImg', 'ChannelController@delImg');//删除渠道图片

        $router->post('ajaxFieldsEdit', 'ChannelController@ajaxFieldsEdit');//单独更新字段

        $router->get('goods', 'ChannelController@goods');//渠道商品

        $router->get('xcxGoods', 'ChannelController@xcxGoods');//支付宝小程序渠道商品
        $router->get('xcxDlGoods', 'ChannelController@xcxDlGoods');//支付宝小程序德龙渠道商品
        $router->get('xcxStGoods', 'ChannelController@xcxStGoods');//支付宝小程序舒坦渠道商品
        $router->get('xcxAbsGoods', 'ChannelController@xcxAbsGoods');//支付宝小程序艾泊斯渠道商品
        $router->get('xcxAblGoods', 'ChannelController@xcxAblGoods');//支付宝小程序爱宝乐渠道商品
        $router->get('jdH5Goods', 'ChannelController@jdH5Goods');//京东h5商品
        $router->get('hbH5Goods', 'ChannelController@hbH5Goods');//花呗h5商品

        $router->get('category', 'ChannelController@category');//渠道分类
        $router->get('xcxCategory', 'ChannelController@xcxCategory');//支付宝小程序渠道分类
        $router->get('xcxDlCategory', 'ChannelController@xcxDlCategory');//支付宝小程序德龙渠道分类
        $router->get('xcxStCategory', 'ChannelController@xcxStCategory');//支付宝小程序舒坦渠道分类
        $router->get('xcxAbsCategory', 'ChannelController@xcxAbsCategory');//支付宝小程序艾泊斯渠道分类
        $router->get('xcxAblCategory', 'ChannelController@xcxAblCategory');//支付宝小程序爱宝乐渠道分类
        $router->get('jdH5Category', 'ChannelController@jdH5Category');//京东h5分类
        $router->get('hbH5Category', 'ChannelController@hbH5Category');//花呗h5分类

        $router->get('addCategory', 'ChannelController@addCategory');//渠道分类添加
        $router->post('addCategory', 'ChannelController@addCategory');//渠道分类添加

        $router->get('editCategory', 'ChannelController@editCategory');//渠道分类添加
        $router->post('editCategory', 'ChannelController@editCategory');//渠道分类编辑



        $router->post('goodsDelete', 'ChannelController@goodsDelete');//渠道商品删除

        $router->post('editSort', 'ChannelController@editSort');//渠道商品排序编辑

        $router->get('getChildHtml', 'ChannelController@getChildHtml');//获取子类html

    });

    $router->group(['prefix' => 'order'], function () use ($router) {
        $router->get('index', 'OrderController@index');//全部订单列表
        $router->get('checkOrders', 'OrderController@checkOrders');//待审核订单列表
        $router->get('sendGoodsOrders', 'OrderController@sendGoodsOrders');//待发货
        $router->get('chukuOrders', 'OrderController@chukuOrders');//已出库订单
        $router->get('receivedGoodsOrders', 'OrderController@receivedGoodsOrders');//待收货
        $router->get('repaymentingOrders', 'OrderController@repaymentingOrders');//已出库订单
        $router->get('overTimeOrders', 'OrderController@overTimeOrders');//逾期订单

        $router->get('overOrders', 'OrderController@overOrders');//完结订单
        $router->get('emptyNumberOrders', 'OrderController@emptyNumberOrders');//未填写快递单号订单
        $router->get('excelOrders', 'OrderController@excelOrders');//订单统计列表

        $router->get('orderStagesInfo', 'OrderController@orderStagesInfo');//订单账单列表


        $router->post('xxhf', 'OrderController@xxhf');//先享后付
        $router->post('quxiao', 'OrderController@quxiao');//取消订单
        $router->post('shenhe', 'OrderController@shenhe');//审核订单
        $router->post('orderConfirmDelivery', 'OrderController@orderConfirmDelivery');//确认出库
        $router->post('fahuo', 'OrderController@fahuo');//确认发货
        $router->post('setNumber', 'OrderController@setNumber');//补填快递单号
        $router->get('orderShow', 'OrderController@orderShow');//订单详情
        $router->get('exportOrderExcel', 'OrderController@exportOrderExcel');//订单导出

        $router->post('setGroup', 'OrderController@setGroup');//订单分组
        $router->post('removeGroup', 'OrderController@removeGroup');//订单分组解除

        $router->get('capitalList', 'OrderController@capitalList');//资金方清单


    });

    //订单分组
    $router->group(['prefix' => 'orderGroup'], function () use ($router) {
        $router->get('index', 'OrderGroupController@index');//订单分组列表

        $router->post('add', 'OrderGroupController@add');
        $router->post('edit', 'OrderGroupController@edit');
        $router->post('delete', 'OrderGroupController@delete');

        $router->get('groupOrderList', 'OrderGroupController@groupOrderList');

    });

    //意见反馈
    $router->group(['prefix' => 'suggestion'], function () use ($router) {
        $router->get('index', 'SuggestionController@index');//意见反馈

    });

    //优惠劵
    $router->group(['prefix' => 'coupon'], function () use ($router) {
        $router->get('index', 'CouponController@index');//优惠券列表
        $router->get('add', 'CouponController@add');//添加优惠券
        $router->post('add', 'CouponController@add');//添加优惠券
        $router->get('edit', 'CouponController@edit');//编辑优惠券
        $router->post('edit', 'CouponController@edit');//编辑优惠券

        $router->post('delete', 'CouponController@delete');//删除优惠券

        $router->post('getCategory', 'CouponController@getCategory');//获取分类

    });

    $router->group(['prefix' => 'log'], function () use ($router) {
        $router->get('h5paylog', 'LogController@h5paylog');//h5支付日志
        $router->get('xyjhlog', 'LogController@xyjhlog');//h5信用借还

        $router->get('xcxlog', 'LogController@xcxlog');//小程序日志
        $router->get('autolog', 'LogController@autolog');//定时器日志
        $router->get('xxhflog', 'LogController@xxhflog');//先享后付日志

    });

    //订单租期
    $router->group(['prefix' => 'orderStages'], function () use ($router) {
        $router->get('index', 'OrderStagesController@index');//订单租期明细
        $router->get('huanKuanOrders', 'OrderStagesController@huanKuanOrders');//订单还款明细
        $router->get('orderStagesExcel', 'OrderStagesController@orderStagesExcel');//订单租期导出
        $router->get('orderStagesList', 'OrderStagesController@orderStagesList');//订单租期列表
    });

    //数据分析
    $router->group(['prefix' => 'analysis'], function () use ($router) {
        $router->get('orderStagesDailyBill', 'AnalysisController@orderStagesDailyBill');//订单分期还款日列表
        $router->get('orderStagesMonthlyBill', 'AnalysisController@orderStagesMonthlyBill');//订单分期还款日列表
        $router->get('orderSummary', 'AnalysisController@orderSummary');//运营报告
    });

    //轮播图
    $router->group(['prefix' => 'lunbo'], function () use ($router) {
        $router->get('index', 'SystermAdController@index');
        $router->get('add', 'SystermAdController@add');
        $router->post('add', 'SystermAdController@add');
        $router->get('edit', 'SystermAdController@edit');
        $router->post('edit', 'SystermAdController@edit');
        $router->post('delete', 'SystermAdController@delete');
        $router->post('ajaxEdit', 'SystermAdController@ajaxEdit');
    });

    //首页排版
    $router->group(['prefix' => 'homePage'], function () use ($router) {
        $router->get('index', 'HomePageController@index');
        $router->post('newGoodsDelete', 'HomePageController@newGoodsDelete');
        $router->post('addNewGoods', 'HomePageController@addNewGoods');
        $router->post('bannerImg', 'HomePageController@bannerImg');//处理banner上传图片
        $router->post('ajaxEditBannerUrl', 'HomePageController@ajaxEditBannerUrl');//异步修改跳转地址
        $router->post('ajaxEditSort', 'HomePageController@ajaxEditSort');//异步修改sort
        $router->post('bannerDelete', 'HomePageController@bannerDelete');//删除banner


    });

    //数据兼容，批量处理sql
    $router->group(['prefix' => 'sql'], function () use ($router) {
        $router->get('goodsSkuSql', 'SqlController@goodsSkuSql');
        $router->get('goodsLease', 'SqlController@goodsLease');

    });







});
